#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int result = QMessageBox::warning(this, "这是一个对话框", "这是一段文本", QMessageBox::Ok | QMessageBox::Cancel);
    if(result == QMessageBox::Ok){
        qDebug() << "ok";
    }
    else if(result == QMessageBox::Cancel){
        qDebug() << "cancel";
    }

}
